<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<html>
	<head>
		<title>前台管理--活动管理--编辑活动</title>
		<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
		<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
		<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
	</head>

	<body>

		<html:form method="post" action="/others/activityManage.do"
			focus="activity.title">
			<input type="hidden" name="method" value="update" />
			<logic:present name="activity">
				<input type="hidden" name="activity.id" value="${activity.id}" />
				<input type="hidden" name="activity.publishUser"
					value="${activity.publishUser}" />
				<input type="hidden" name="activity.del" value="${activity.del}" />
				<table align="center" width="400px">
					<tr>
						<th colspan="2" height="25px">
							编辑活动
						</th>
					<tr>
						<td class="td_01">
							标题：
						</td>
						<td class="td_03">
							<input type="text" name="activity.title"
								value="${activity.title}" />
						</td>
					</tr>
					<tr>
						<td class="td_01">
							简介：
						</td>
						<td class="td_03">
							<input type="text" name="activity.summary"
								value="${activity.summary}" />
						</td>
					</tr>
					<tr>
						<td class="td_01">
							顺序：
						</td>
						<td class="td_03">
							<input type="text" name="activity.sequence"
								value="${activity.sequence}"  id="sequence" onchange="javascript:testisNum('sequence')"/>
						</td>
					</tr>
					<tr>
						<td class="td_01">
							链接地址：
						</td>
						<td class="td_03">
							<input type="text" name="activity.url" value="${activity.url}" />
						</td>
					</tr>
					<tr>
						<td class="td_01">
							内容：
						</td>
						<td class="td_03">
							<textarea rows="8" cols="25" name="activity.content" id="content">${activity.content}</textarea>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="td_01">
							<input name="submit" class="btn" type="submit" value="提交">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" class="btn" name="return" value="返回" onmousedown="javascript:history.go(-1);" />
						</td>
					</tr>
				</table>
			</logic:present>
		</html:form>
	</body>
	<script type="text/javascript">
	 function testisNum(id){
	 var object=document.getElementById(id);
      var s =document.getElementById(object.id).value;
          if(s!=""){
             if(isNaN(s)){
                 alert("请输入数字");
                 object.value=0;
                 object.focus();
                 return;
             }
          }else{
                 alert("此处不能为空！默认值为0！");
                 object.value=0;
                 object.focus();
                 return;
          }
   }
   //获得内容控件
   var content=document.getElementById("content");
   content.onchange=function(){
       var str=content.value;
       str=bb(aa(str));
       content.value=str;
   }
  function aa(str){
        return   str.replace(/^[\s]+/,"");   
  }     
  function bb(str){
        return   str.replace(/[\s]+$/,"");
  }  
	</script>
</html>
